<template>
  <div class="bigbox">


    <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
      <el-form-item label="年级:" prop="region">
        <el-select v-model="ruleForm.region" placeholder="年级">
        <el-option label="一年级" value="一年级"></el-option>
        <el-option label="二年级" value="二年级"></el-option>
        <el-option label="三年级" value="三年级"></el-option>
      </el-select>
    </el-form-item>

    <el-form-item label="标题:" prop="name">
      <el-input v-model="ruleForm.name"></el-input>
    </el-form-item>



    <el-form-item label="试卷:" prop="desc">
      <!-- <el-input type="textarea" v-model="ruleForm.desc"></el-input> -->
      <!-- 表格 -->
      <el-table
      :data="tableData"
      border
      style="width: 100%">
      <el-table-column
        prop="subject"
        label="学科"
        width="180">
      </el-table-column>
      <el-table-column
        prop="name"
        label="名称"
        width="590">
      </el-table-column>
      <el-table-column
        prop="addtime"
        label="创建时间"
        width="180">
      </el-table-column>
      <el-table-column
        prop="operate"
        label="操作">
      </el-table-column>
    </el-table>
    </el-form-item>

    <el-button type="primary">提交</el-button>
    <el-button>重置</el-button>
    <el-button type="success">添加试卷</el-button>

  </el-form>

  
  
  </div>
</template>

<script>
export default {
    data() {
      return {
        // 表格数据
        tableData: [
        // {
        //   sbubject: '',
        //   name: '',
        //   addtime: '',
        //   operate: ''
        // }, 
      ],
        // 
        ruleForm: {
          name: '',
          region: '',
          date1: '',
          date2: '',
          delivery: false,
          type: [],
          resource: '',
          desc: ''
        },
        rules: {
          region: [
            { required: true, message: '年级', trigger: 'blur' }
          ],
          name: [
            { required: true, message: '请输入任务标题', trigger: 'blur' },
            { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
          ],
          desc: [
            { required: true,}
          ]
        }
      };
    },
    methods: {
      submitForm(formName) {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            alert('submit!');
          } else {
            console.log('error submit!!');
            return false;
          }
        });
      },
      resetForm(formName) {
        this.$refs[formName].resetFields();
      }
    }
  }
</script>

<style scoped>
 .bigbox{
    background-color: #fff;
    padding: 30px;
  }
  .el-button--primary{
    margin-left: 100px;
  }
</style>